{__NOLAYOUT__}

<form data-method="post" data-action="{:url('admin/category/saveData')}" data-submit="ajax" data-validate="true" class="form-horizontal">
    <div class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span></button>
                    <h3 class="modal-title">{$data['id']?lang('Edit'):lang('Add')}{:lang('Category')}</h3>
                </div>
                <input type="hidden" name="id" value="{$data.id ?? ''}">
                <div class="modal-body">
                    <div class="modal-body-content">
                        <div class="form-group must">
                            <label class="col-sm-3 control-label">{:lang('FromCategory')}</label>
                            <div class="col-sm-7">
                                <select name="pid" id="" class="form-control" required>
                                    <option value="0">顶级分类</option>
                                    {volist name="roleData" key="key" id="vo"}
                                    <option value="{$key-1}" {$data['pid']==($key-1) ? 'selected' : ''}>{$vo}</option>
                                    {/volist}
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">{:lang('CategoryName')}</label>
                            <div class="col-sm-7"> 
                                <input type="text" class="form-control" name="name" maxlength="11" placeholder="{:lang('Up_characters',['langth' =>25])}" required value="{$data.name ?? ''}"  >
                            </div>
                        </div>


                        <div class="form-group">
                            <label class="col-sm-3 control-label">{:lang('SeoTitle')}</label>
                            <div class="col-sm-7">
                                <input type="text" class="form-control equalto" name="seo_title" rangelength="[2,50]" placeholder="{:lang('Range_characters',['minLangth' =>2,'maxLangth' => 50])}" required value="{$data.seo_title ?? ''}">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">{:lang('SeoKeys')}</label>
                            <div class="col-sm-7">
                                <input type="text" class="form-control equalto" name="seo_keys" rangelength="[2,50]" placeholder="{:lang('Range_characters',['minLangth' =>2,'maxLangth' => 50])}" required value="{$data.seo_keys ?? ''}">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">{:lang('SeoDesc')}</label>
                            <div class="col-sm-7">
                                <input type="text" class="form-control equalto" name="seo_desc" rangelength="[2,100]" placeholder="{:lang('Range_characters',['minLangth' =>2,'maxLangth' => 50])}" required value="{$data.seo_desc ?? ''}">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">{:lang('Status')}</label>
                            <div class="col-sm-7">
                                <select name="status" class="form-control" required>
                                    <option value="1" {$data['status']==1 ? 'selected' : ''}>{:lang('Start')}</option>
                                    <option value="2" {$data['status']==2 ? 'selected' : ''}>{:lang('Hide')}</option>
                                    <option value="0" {$data['status']==0 ? 'selected' : ''}>{:lang('Off')}</option>
                                </select>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">{:lang('Cancel')}</button>
                    <button type="submit" class="btn btn-primary">{:lang('Save')}</button>
                </div>
            </div>
        </div>
    </div>
</form>